<?php
	
	session_start();
	require("connect.php");
	$link = connect_APO();
	
	$type= $_SESSION['type'];
	
	if (!session_is_registered('ID')) :
		header('Location: login.php');
	endif;
	
	if ($type != 'coordinator'){
		header('Location: index.php');
	}
	
	require("header+logoutB.php");
	headerL();
	
	$sql = sprintf("SELECT `ID`, `Fname`, `Lname` FROM `users` WHERE `MC` =0 AND `Status`='Brother'");
	$result= mysql_query($sql);
	
	$numberPeople=0;
	while($row = mysql_fetch_array($result)){
		$personID[] = $row["ID"];
		$personFName[] = $row["Fname"];
		$personLName[] = $row["Lname"];
		$numberPeople +=1;
	}
	
	echo "<html>
<body class='main'>

<FONT class='mainFont'>
  <CENTER>
    <!--<p><img src = 'images/apopic.jpg'></p>-->
    <br>
	<br>
	  <div class='modifyAdminTable'>
	  <div id='links'>
	  <div id='backLink'> <A href='usersAdmin.php'>Back to Users Administration</A></div></div>
	  <b class='b1f'></b><b class='b2f'></b><b class='b3f'></b><b class='b4f'></b>
	  <div class='contentf'>
		  <div class = 'headerText'>
				Switch Midweek Coordinators:
		  </div>
		  <div class='modifyAdminDesc'>You are the current midweek coordinator. To switch your position with another person, click their name.</div>
		  ";
		  
	for($i=0; $i<$numberPeople; $i+=1){
		echo "<div class='modifyAdminName'><a href='confirmModifyAdmin.php?new_MC=$personID[$i]'>$personFName[$i] $personLName[$i]</a></div>
		";
	}
	
	echo "</div>
	  <b class='b4f'></b><b class='b3f'></b><b class='b2f'></b><b class='b1f'></b>
		</div>
	</center>
</font>
</body>
</head>
</html>";

	require("footer.php");
	footer();
mysql_close($link);
?>
